﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TaskManagement.ModelLayer;

namespace DataAccess
{
    public interface IDBTask
    {
        /// <summary>
        /// Search trough tasks in the database
        /// </summary>
        /// <param name="searchTask">The task containing the data to search for</param>
        /// <returns>A list of results</returns>
        IList<Task> SearchTask(Task searchTask);

        /// <summary>
        /// Creates a task in the database
        /// </summary>
        /// <param name="task">The task to create</param>
        /// <returns>The id of the created task if succesfull, or 0 on faliure</returns>
        int CreateTask(Task task);

        /// <summary>
        /// Deletes all the tasks in tasks
        /// </summary>
        /// <param name="tasks">The IList containin the tasks to delete</param>
        /// <returns>1 if succesfull or 0 on faliure</returns>
        int DeleteTasks(IList<Task> tasks);

        /// <summary>
        /// Updates a excisting task
        /// </summary>
        /// <param name="task">The task to update, must have a excisting id</param>
        /// <returns>1 on succes, 0 on faliure</returns>
        int UpdateTasks(Task task);


        /// <summary>
        /// Gets all accounts from the db
        /// </summary>
        /// <returns>A Ilist of all accounts or null if a error occured</returns>
        IList<string> GetAccounts();

        /// <summary>
        /// Gets all tags from the db
        /// </summary>
        /// <returns>A Ilist of all tags or null if a error occured</returns>
        IList<string> GetTags();

        /// <summary>
        /// Gets all deliverys from the db
        /// </summary>
        /// <returns>A Ilist of all deliverys or null if a error occured</returns>
        IList<string> GetDeliverys();


    }
}
